package com.demo.gulimall.ware.mapper;

import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import java.util.List;
import org.apache.ibatis.annotations.Mapper;
import com.demo.gulimall.ware.entity.WareSku;
import org.apache.ibatis.annotations.Param;

/**
 * 商品库存
 *
 * @author Chen Yuan
 */

@Mapper
public interface WareSkuMapper extends BaseMapper<WareSku> {

	Long getSkuStock(@Param("skuId") Long skuId);

	List<Long> getWareIdHasSkuStock(@Param("skuId") Long skuId);

	Long lockSkuStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);

	void unlockStock(@Param("skuId") Long skuId, @Param("wareId") Long wareId, @Param("num") Integer num);
}
